Logitec webcam - getting it to work

chris (2003-05-26 00:26:46)
16051 views
0 replies
logitec quickcam driver - compiling the module
-----------------------------------------------

Fist I wanted to compile the qce-ga-0.40d driver, but it was barfing with:

quickcam.c: In function `quickcam_mmap':
quickcam.c:2099: warning: passing arg 1 of `remap_page_range_R2baf18f2' makes pointer from integer without a castquickcam.c:2099: incompatible type for argument 4 of `remap_page_range_R2baf18f2'
quickcam.c:2099: too few arguments to function `remap_page_range_R2baf18f2'
quickcam.c: At top level:
quickcam.c:2126: warning: initialization from incompatible pointer type
make: *** [quickcam.o] Error 1

After a bit of googling, it turns out that the mmap() interfaces have changed under RH9 so basically the driver now takes 5 arguments instead of 4.

This was fairly simple to fix. Make sure the mmap() function definition looks like:

static int function_mmap(struct vm_area_struct *vma, struct whatever *btv, const char *adr, unsigned long size)

and then make sure any remap_page_range() calls have 'vma' as their first
argument. Insert it if they don't.


Installing the module
----------------------

less /proc/bus/usb/devices | grep Camera to find a line that says Camera. This indicates the webcam has been detected.

You need to have the kernel source RPM for your current kernel installed. Installation of that RPM automatically creates a /usr/src/linux-2.4 symbolic link to the /usr/src/linux-2.4.x kernel source (where x is your sub-version of 2.4). Now go to the /usr/src directory by typing cd /usr/src. I got this off Redhat's SRPMS2 cd and installed it.

Once you are in the /usr/src folder and you see the /usr/src/linux-2.4 symbolic link, create a new symbolic link called linux by typing ln -s linux-2.4 linux. Now type exit to go back and become your regular user again.

Enter the quickcam driver source code directory by typing cd /usr/src/qce-ga-0.40b. Type make to create the driver file. You should now see a file if you type ls -l mod_quickcam.o. Become root again, and type chown root:root mod_quickcam.o to change ownership of the mod_quickcam.o file to the root user. That's the driver module compiled (thanks to the patch above).

As root, open your /etc/modules.conf. If there isn't a line present that reads keep, add it. Add the following statement after the 'keep' line: path=/usr/src/qce-ga-0.40d. This will add that qce directory to the list of places for the operating system to look for kernel modules.

Now, still as root, type depmod -a. You will notice that it complains that several files in the qce* directory do not belong to root. Ignore these warnings.

At this point it may be possible to start up the quickcam driver by unplugging it from the USB port and plugging it back into the USB port, but I'm not certain. Rebooting the computer should start the quickcam driver at boot time, and you can tell if the driver is loaded by executing an lsmod when you are the root user. You should see the quickcam driver in the list of modules currently loaded at that time.

Find an install the latest xawtv for your distribution. I recommend using the RPM file, which you can find at rpmfind.net by searching for 'xawtv'.

The webcam will probably be installed as /dev/video0. Once you have installed the xawtv program, you can see the video coming from the webcam by running xawtv -c /dev/video0. I did and it's fucking awsome!! But I don't want to record movies at the moment.. I want stills, so..

Now to get it grabbing and uploading to Brezhnev:
comment